{varType array $txt}
{varType array $context}
{varType array $modSettings}

{var $need_lower_case = $txt[lang_dictionary] in [pl, es, ru, uk]}
{var $labels = [lp_type_block, lp_type_editor, lp_type_comment, lp_type_parser, lp_type_article, lp_type_frontpage, lp_type_impex, lp_type_block_options, lp_type_page_options, lp_type_icons, lp_type_seo, lp_type_other, lp_type_ssi]}

<div class="row">
	<div class="article_flarum_view col-xs-12">
		{do show_pagination()}

		<div class="roundframe">
			<div class="title_bar">
				<h2 class="titlebg">{$context[page_title]}</h2>
			</div>
			<div n:foreach="$context[lp_frontpage_articles] as $article" class="windowbg row">
				<div class="col-xs-12">
					<div class="row">
						<div class="header_img col-xs-2">
							<span n:if="empty($article[image])">{icon('big_image')}</span>
							<span n:if="!empty($article[image])">
								<img class="avatar" loading="lazy" src="{$article[image]}" alt="{$article[title]}">
							</span>
						</div>
						<div class="header_area col-xs">
							<h3>
								<a href="{$article[link]}">{$article[title]}</a>
								<span n:if="$article[is_new]" class="new_posts">{$txt['new']}</span>
							</h3>
							<div n:if="!empty($article[section][name])" class="smalltext hidden-md hidden-lg hidden-xl">
								<span class="new_posts {php echo $labels[random_int(0, count($labels) - 1)]}" href="{$article[section][link]}">{$article[section][name]}</span>
								<span n:if="!empty($article[replies][num])" style="margin-left: 1em">
									<i class="far fa-comment"></i> {$article[replies][num]}
								</span>
							</div>
							<div class="smalltext">
								<span n:if="!empty($article[replies][num])">{icon('reply')}</span>
								<span n:if="!empty($modSettings[lp_show_author]) && !empty($article[author])">{$article[author][name] ?? $txt[guest_title]}</span>
								<span n:attr="style: $need_lower_case ? 'text-transform: lowercase' : ''">
									{$article[date]|noescape}
								</span>
							</div>
						</div>
						<div class="righttext smalltext hidden-xs hidden-sm col-xs-2">
							<a n:if="!empty($article[section][name])" class="new_posts {php echo $labels[random_int(0, count($labels) - 1)]}" href="{$article[section][link]}">{$article[section][name]}</a>
							<div n:if="!empty($article[replies][num])"><i class="far fa-comment"></i> {$article[replies][num]}</div>
						</div>
					</div>
				</div>
				<div n:if="!empty($article[teaser])" class="col-xs-12">{teaser($article[teaser])}</div>
			</div>
		</div>

		{do show_pagination(bottom)}
	</div>
</div>
